package com.gxh.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.gxh.annotation.AutoFill;
import com.gxh.dto.LocationPageQueryDTO;
import com.gxh.entity.Location;
import com.gxh.enumeration.OperationType;
import org.apache.ibatis.annotations.Insert;

public interface LocationMapper extends BaseMapper<Location> {
    /**
     * 分页查询
     * @param locationPageQueryDTO
     * @return
     */
    Page<Location> pageQuery(LocationPageQueryDTO locationPageQueryDTO);

    /**
     * 新增
     * @param location
     */
    @Insert("insert into location(province,city,create_time,create_user,update_time,update_user) " +
            "values(#{province},#{city},#{createTime},#{createUser},#{updateTime},#{updateUser})")
    @AutoFill(OperationType.INSERT)
    void insertLocation(Location location);

    /**
     * 修改
     * @param location
     */
    @AutoFill(OperationType.UPDATE)
    void updateLocation(Location location);
}
